using System;

namespace SharpMud.MudLib.SAMPLE.Messaging.Act.BuiltIn.Communication
{
	namespace Say
	{
		public class ToSender : IActMessage
		{
			#region Private Variables
			private string _Message;
			#endregion
			
			#region Constructors
			private ToSender()
			{}

			public ToSender(string message)
			{
				_Message = message;
			}
			#endregion

			#region Public Properties
			public string Message
			{
				get
				{
					return this._Message;
				}
			}
			#endregion
			
			#region IActMessage Members

			public IActMessageParameter[] Parameters
			{
				get
				{
					return new IActMessageParameter[] { new ActMessageParameter("Message",this._Message) };	
				}
			}

			public string ToAbsoluteValue()
			{
				return String.Format("[green]You say, \"[#black][white]{0}[#black][green]\"",this._Message);
			}

			#endregion
		}


		public class ToRecipient : IActMessage
		{
			#region Private Variables
			private string				_Message;
			private Entities.ICharacter	_Sender;
			private Entities.ICharacter	_Recipient;
			#endregion
			
			#region Constructors
			private ToRecipient()
			{}

			public ToRecipient(Entities.ICharacter sender, string message, Entities.ICharacter recipient)
			{
				_Sender = sender;
				_Message = message;
				_Recipient = recipient;
			}
			#endregion

			#region Public Properties
			public string Message
			{
				get
				{
					return this._Message;
				}
			}

			public Entities.ICharacter Sender
			{
				get
				{
					return this._Sender;
				}
			}

			public Entities.ICharacter Recipient
			{
				get
				{
					return this._Recipient;
				}
			}
			#endregion
			
			#region IActMessage Members

			public IActMessageParameter[] Parameters
			{
				get
				{
					return new IActMessageParameter[] { 
										new ActMessageParameter("Message",this._Message),
										new ActMessageParameter("Sender",this._Sender),
										new ActMessageParameter("Recipient",this._Recipient)
													  };	
				}
			}

			public string ToAbsoluteValue()
			{
				return String.Format("[green]{0} says, \"[#black][white]{1}[#black][green]\"",
					this._Sender.GetShortDescription(this._Recipient),
					this._Message );
			}

			#endregion
		}


		public class AnonymouslyToRecipient : IActMessage
		{
			#region Private Variables
			private string _Message;
			#endregion
			
			#region Constructors
			private AnonymouslyToRecipient()
			{}

			public AnonymouslyToRecipient(string message)
			{
				_Message = message;
			}
			#endregion

			#region Public Properties
			public string Message
			{
				get
				{
					return this._Message;
				}
			}
			#endregion
			
			#region IActMessage Members

			public IActMessageParameter[] Parameters
			{
				get
				{
					return new IActMessageParameter[] { new ActMessageParameter("Message",this._Message) };	
				}
			}

			public string ToAbsoluteValue()
			{
				return String.Format("Someone says, \"{0}\"",this._Message);
			}

			#endregion
		}
	}
}
